package com.axjy.yycg.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermissionMapper {


    @Select("select menu_id from permission where role_id=#{roleId}")
    public List<Integer> findMenuIdsByRoleId(Integer roleId);

    @Delete("delete from permission where role_id=#{roleId}")
    public Integer del(Integer roleId);

    @Insert("insert into permission(role_id,menu_id) values(#{roleId},#{menuId})")
    public Integer add(@Param("roleId") Integer roleId,@Param("menuId") Integer menuId);
}
